.section .text, "a"
.global apmcu_icache_invalidate
.type apmcu_icache_invalidate, #function
apmcu_icache_invalidate:
    MOV r0, #0
    MCR p15, 0, r0, c7, c5, 0  /* CHECKME: c5 or c1 */
    BX  lr
.size apmcu_icache_invalidate, . - apmcu_icache_invalidate

.global apmcu_isb
.type apmcu_isb, #function
apmcu_isb:
    ISB
    BX  lr
.size apmcu_isb, . - apmcu_isb

.global apmcu_disable_icache
.type apmcu_disable_icache, #function
apmcu_disable_icache:
    MOV r0,#0
    MCR p15,0,r0,c7,c5,6   /* Flush entire branch target cache */
    MRC p15,0,r0,c1,c0,0
    BIC r0,r0,#0x1800      /* I+Z bits */
    MCR p15,0,r0,c1,c0,0
    BX  lr
.size apmcu_disable_icache, . - apmcu_disable_icache

.global apmcu_disable_smp
.type apmcu_disable_smp, #function
apmcu_disable_smp:
    MRC p15,0,r0,c1,c0,1
    BIC r0,r0,#0x040       /* SMP bit */
    MCR p15,0,r0,c1,c0,1
    BX  lr
.size apmcu_disable_smp, . - apmcu_disable_smp